const exec = require("child_process").exec;
function execute(cmd) {
  exec(cmd, function (error) {
    if (error) {
      console.error(error);
    } else {
      console.log("push 成功");
    }
  });
}
let message = process.argv[2];
if (!message) {
  throw new Error("请输入提交内容");
}
if (message) {
  execute(`git add . && git commit -m ${message} && git push`);
}
